sse-fixups: use more portable functions to help compile with clang
authorMichael Muré <batolettre@gmail.com>
Tue, 22 May 2012 03:48:44 +0000 (12:48 +0900)
committerMichael Muré <batolettre@gmail.com>
Tue, 22 May 2012 03:48:44 +0000 (12:48 +0900)
Original patch found here
http://www.freebsd.org/cgi/cvsweb.cgi/ports/x11/babl/files/patch-sse-fixups.c?rev=1.1;content-type=text%2Fplain

CVS tags: RELEASE_8_3_0, HEAD

Fix the build with clang.

PR: ports/163518
Submitted by: Jan Beich <jbeich@tormail.net>
Feature safe: yes

extensions/sse-fixups.c

index fdcc06f7e98a570ccd7a62c5a962413d135e6946..95f1cc87455796ccf053977211c2942a3ed29d70 100644 (file)
@@ -23,6 +23,8 @@
 
 #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
 
+#include <xmmintrin.h>
+
 #include <stdint.h>
 #include <stdlib.h>
 
@@ -40,11 +42,11 @@ typedef int   g2int   __attribute__ ((vector_size (2*sizeof(int))));
 #define g4float_zero      g4float_all(0.0)
 #define g4float_ff        g4float_all(255.0)
 
-#define g4float_max(a,b)    __builtin_ia32_maxps(a, b)
-#define g4float_min(a,b)    __builtin_ia32_minps(a, b)
-#define g4float_cvt2pi(a)   __builtin_ia32_cvtps2pi(a)
-#define g4float_movhl(a,b)  __builtin_ia32_movhlps(a, b)
-#define g4float_emms        __builtin_ia32_emms
+#define g4float_max(a,b)    _mm_max_ps(a, b)
+#define g4float_min(a,b)    _mm_min_ps(a, b)
+#define g4float_cvt2pi(a)   _mm_cvtps_pi32(a)
+#define g4float_movhl(a,b)  _mm_movehl_ps(a, b)
+#define g4float_emms        _mm_empty
 
 
 static INLINE long